import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Loginview from '@/views/Loginview.vue'
import Binglichaxun from '@/components/Binglichaxun.vue'
import Shoufei from '@/components/Shoufei.vue'
import Shouye from '@/components/Shouye.vue'
import Yiliaoguanli from '@/components/Yiliaoguanli.vue'
import shoufeidetail from '@/components/shoufeidetail.vue'
import { setCustomertype, getCustomertype,customertype } from '@/glob'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: Loginview,
    },
    {
      path: '/home/:id',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/yiliaoguanli',
          name: 'yiliaoguanli',
          component: Yiliaoguanli,
        },
        {
          path: '/shouye',
          name: 'shouye',
          component: Shouye,
        },
        {
          path: '/binglichaxun',
          name: 'binglichaxun',
          component: Binglichaxun,
        },
        {
          path: '/shoufeidetail/:mid',
          name: 'shoufeidetail',
          component: shoufeidetail,
        },
        {
          path: '/shoufei',
          name: 'shoufei',
          component: Shoufei,
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: () => import('../views/NotFound.vue'),
    },
  ],
})









export default router